Fixed a problem in which only ConfigId was calculated first when the API parameter was set to Known After Apply #16946
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If certain attributes such as protoc_output_base64 are modified, the config_id is pre-computed, but if these attributes are (known after apply) at plan time and there is no diff as a result of apply, the plan result will not match, Error: Provider produced inconsistent final plan.
Therefore, if these attributes are modified and their values are non-deterministic, the config_id is now also calculated at apply time.
The added test case has the dependency endpoints <- key2 <- key1, and the attribute of key2 is used in grpc_config of endpoints.
If the attribute of key2 referenced in endpoints is known after apply for some reason, and as a result there is no diff in the attribute of key2, only the config_id will be changed, but in that case it will not be applied and
Provider produced inconsistent final plan
error happened.As a specific case, we have confirmed the occurrence of this problem in the product code in cases where grpc-config, protoc-descriptor, etc. are obtained through multiple resources such as local_file, etc. and external files obtained by null_resource.
I have closed P/R and newly opened because discovering that the previous P/R had many incorrect modified source code, corrections, tests, etc.
Fixes #11776
Release Note Template for Downstream PRs (will be copied)
Derived from GoogleCloudPlatform/magic-modules#9708